from django.db import models
from django.utils.timezone import now


class MFileModel(models.Model):
    id = models.CharField(db_column="c_id", max_length=32, verbose_name=u"主键", primary_key=True, blank=False,
                          null=False)
    filename = models.CharField(db_column="c_file_name", max_length=200, verbose_name="文件名")
    filepath = models.CharField(db_column="c_file_path", max_length=500, verbose_name="文件路径")
    filetype = models.IntegerField(db_column="c_file_type", verbose_name="文件类型")
    is_exist = models.BooleanField(db_column="c_is_exist", default=False)
    create_date = models.DateTimeField(db_column="c_create_date", default=now)

    class Meta:
        db_table = "t_mfile"
        verbose_name = "文件列表"
        verbose_name_plural = verbose_name
        ordering = ["create_date"]
